<template>
  <view class="User_container">
    <view class="top">
      <view class="image">
        <image :src="userInfo.avatarUrl" mode=""></image>
      </view>
      <text>{{userInfo.nickName}}</text>
    </view>
    <view class="footer">
      <view class="footer_top">
        <view class="">
          <text>8</text>
          <text>收藏的店铺</text>
        </view>
        <view class="">
          <text>14</text>
          <text>收藏的商品</text>
        </view>
        <view class="">
          <text>18</text>
          <text>关注的商品</text>
        </view>
        <view class="">
          <text>8</text>
          <text>足迹</text>
        </view>
      </view>
      <view class="footer_middle">
        <view class="dingdan">
          我的订单
        </view>
        <view class="button_list">
          <view class="">
            <image src="../../static/my-icons/icon1.png" mode=""></image>
            <text>待付款</text>
          </view><view class="">
            <image src="../../static/my-icons/icon2.png" mode=""></image>
            <text>待收获</text>
          </view><view class="">
            <image src="../../static/my-icons/icon3.png" mode=""></image>
            <text>退款/退货</text>
          </view><view class="">
            <image src="../../static/my-icons/icon4.png" mode=""></image>
            <text>全部订单</text>
          </view>
        </view>
      </view>
      <view class="footer_bottom">
        <view class="">
          <text>收货地址</text>
          <uni-icons type="forward" size="16"></uni-icons>
        </view>
        <view class="">
          <text>联系客服</text>
          <uni-icons type="forward" size="16"></uni-icons>
        </view>
        <view class="" @click="loginOut">
          <text>退出登录</text>
          <uni-icons type="forward" size="16"></uni-icons>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
  import {mapState} from 'vuex'
  export default {
    name:"Myuserinfo",
    data() {
      return {
        
      };
    },
    computed:{
      ...mapState('userStore',['userInfo'])
    },
    methods:{
      loginOut(){
        uni.showModal({
          title:"提示",
          content:"您确定要退出登录吗？",

          success:  (res)=>{
          		if (res.confirm) {
                this.$store.commit('userStore/loginout')
                 this.$store.commit('cartStore/deleteAddress', {})
          		} else if (res.cancel) {
          		}
          	}
        })
      }
    },
    mounted() {
      uni.$showMsg('登录成功')
    }
  }
</script>

<style lang="scss">
  page{
  }
.User_container{
  height: 100vh;
  background-color: #f3f3f3;
  position: relative;
}
.top{
  height: 200px;
  background-color: #c00000;
  display: flex;
  flex-direction: column;
  align-items: center;
  .image{
    margin-top:30px ;
     overflow: hidden;
    border-radius: 50%;
    image{
      width: 100px;
      height: 100px;
    }
  }
  text{
    margin-top: 10px;
    color: #fff;
  }
}
.footer{
  width: 100%;
  font-weight: bold;
  box-sizing: border-box;
  position: absolute;
  padding: 0 10px;
  transform: translateY(-10px);
  .footer_top{
    display: flex;
    font-size: 12px;
    justify-content: space-between;
    border-radius: 5px;
    width: 100%;
    height: 100rpx;
    background-color: #fff;
    view{
      padding: 0 10px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }
  }
  .footer_middle{
    background-color: #fff;
    margin-top: 10px;
    padding-bottom: 20rpx;
    display: flex;
    flex-direction: column;
    .dingdan{
      padding-left: 10px;
      height: 120rpx;
      line-height: 100rpx;
      font-size: 14px;
    }
    .button_list{
      display: flex;
      justify-content: space-between;
      view{
        width: 25%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        image{
          width: 60rpx;
          height: 60rpx;
        }
        text{
          font-size: 12px;
          color: #333;
        }
      }
    }
  }
  .footer_bottom{
    margin-top: 10px;
    background-color: #fff;
    view{
      padding: 0 10px;
      height: 100rpx;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    
  }
}
</style>